﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using NetMicro.EventBus.Messages;
using System.Data;

namespace NetMicro.EventBus
{
    /// <summary>
    /// 执行失败消息发送到死信队列
    /// </summary>
    public interface IEventErrorSendDeadLetter
    {

        /// <summary>
        /// 失败消息发送到私信队列
        /// </summary>
        /// <param name="messageTransfer">消息传输模型</param>
        /// <param name="cancellationToken"></param>
        /// <returns>消息接收处理结果</returns>
        Task OnSendDeadLetterAsync(MessageTransfer messageTransfer,
           IDbTransaction transaction = null, CancellationToken cancellationToken=default);
    }
}
